//
//  WMESongListCell.m
//  WMEMusic
//
//  Created by 恩叔 on 16/4/28.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import "WMESongListCell.h"

@interface WMESongListCell ()
@property (nonatomic, strong)UILabel *songName;
@property (nonatomic, strong)UILabel *name;
@end
@implementation WMESongListCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.songName = [[UILabel alloc] init];
//        _songName.backgroundColor = [UIColor redColor];
        _songName.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_songName];
        
        self.name = [[UILabel alloc] init];
//        _name.backgroundColor = [UIColor orangeColor];
        _name.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_name];
    }
    return self;
}
-(void)setModel:(WMESongListModel *)model
{
    if (_model != model) {
        _model = model;
        _songName.text = _model.title;
        _name.text = _model.author;
    }
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    WS(ws);
    [_songName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(ws.mas_left).with.offset(10);
        make.top.equalTo(ws.mas_top).with.offset(10);
        make.width.equalTo(@(WIDTH/2));
        make.height.equalTo(@(20));
    }];
    
    [_name mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(ws.mas_left).with.offset(10);
        make.top.equalTo(_songName.mas_bottom).with.offset(5);
        make.width.equalTo(@(WIDTH/2));
        make.height.equalTo(@15);
    }];
}
@end
